/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React from "react";
import { Button } from "antd";
import { useDispatch } from "dva";

const UnbindButton = ({ onRefresh }) => {
  const dispatch = useDispatch();

  const onClick = () => {
    dispatch({
      type: "platform/unBindSubYz",
    }).then(() => {
      dispatch({
        type: "platform/isCityLeague",
      });
      onRefresh && onRefresh();
    });
  };

  return (
    <Button type="primary" onClick={onClick}>
      解绑
    </Button>
  );
};

export default UnbindButton;
